package day5

object Test12 {
  /*def main(args: Array[String]): Unit = {
    val f1 = (v1:Int,v2:Int) => v1 + v2

    println(f1(11, 22))
  }*/
  def main(args: Array[String]): Unit = {
    val i: Int = test1((a1,a2)=>a1-a2,10,20)
    println(i)

    val user = User()   //或者 val user = User.apply()
    user.test2()
  }

  def test1(f1:(Int,Int)=>Int,v1:Int,v2:Int)={
    f1(v1,v2)
  }

  class User {

    def test2(): Unit ={
      println("test2方法execute")
    }

  }

  object User{

    def apply(): User = {
      println("11111111")
      new User()
    }

  }



}
